package com.itboye.mengwu.data.presenter;

import java.util.List;
import java.util.Observer;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.object.BasePresenter;
import com.itboye.core.object.ResultEntity;
import com.itboye.mengwu.data.interfaces.IMyLunTan;
import com.itboye.mengwu.data.interfaces.IRedBag;
import com.itboye.mengwu.data.model.LuntanTieZiBean;
import com.itboye.mengwu.data.model.MyLunTanBean;
import com.itboye.mengwu.data.model.RedBagModel;
import com.itboye.mengwu.data.repository.MyLunTanRepository;
import com.itboye.mengwu.data.repository.RedBagRepository;

public class MyTieZiCenterPresenter extends BasePresenter implements IMyLunTan<LuntanTieZiBean>{

	public static final  String QueryMyTieZiSuccess="QueryMyTieZiSuccess";
	public static final String QueryMyTieZiFail="QueryMyTieZiFail";
	
	
	public static final  String MyPingjiaSucess="MyPingjiaSuccess";
	public static final String MyPingJiaFaill="MyPingjiaFail";
	
	public static final  String MyZengSongPingjiaSucess="MyZengSongPingjiaSuccess";
	public static final String MyZengSongPingJiaFaill="MyZengSongPingjiaFail";
	
	public MyTieZiCenterPresenter(Observer observer) {
		super(observer);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(LuntanTieZiBean model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(LuntanTieZiBean model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(LuntanTieZiBean model) {
		// TODO Auto-generated method stub
		//我的帖子
		IMyLunTan<LuntanTieZiBean> redBag = new MyLunTanRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(QueryMyTieZiSuccess);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(QueryMyTieZiFail);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.getInfo(model);
	}

	@Override
	public void getInfo(LuntanTieZiBean model) {
		// TODO Auto-generated method stub
		IMyLunTan<LuntanTieZiBean> redBag = new MyLunTanRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(QueryMyTieZiSuccess);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(QueryMyTieZiFail);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.getInfo(model);
	}

	@Override
	public List<LuntanTieZiBean> query(LuntanTieZiBean model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void MyTheme(String page_no, String page_size, String uid,
			String img_num) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void MyTieZi(String page_no, String page_size, String uid,
			String img_num) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void MyPingLun(String uid) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void MyThemeReply(String page_no, String page_size, String uid,
			String img_num) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void MyTieZiPinglun(String page_no, String page_size, String uid) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void MyPingJia(String uid,String max_img,String page_no,String page_size) {
		// TODO Auto-generated method stub
		IMyLunTan<LuntanTieZiBean> redBag = new MyLunTanRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(MyPingjiaSucess);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(MyPingJiaFaill);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.MyPingJia( uid,max_img, page_no, page_size);
	}

	@Override
	public void MyZengSongPingJia(String uid, String max_img, String page_no, String page_size) {
		// TODO Auto-generated method stub
		IMyLunTan<LuntanTieZiBean> redBag = new MyLunTanRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(MyZengSongPingjiaSucess);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(MyZengSongPingJiaFaill);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.MyZengSongPingJia( uid,max_img, page_no, page_size);
	}

}
